<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        *{
            margin:0px;
            padding:0px;
            /*box-sizing: border-box;*/
        }
        .box{
            width: 200px;
            margin:0 auto;
        }
        html,body{
            height: 100%;
        }
        .wrapper{
            background-color: green;
            min-height: 100%;
            margin-bottom: -50px;
        }
        .footer{
            background-color: blue;
            height: 50px;
        }
        .content{
            background-color: rebeccapurple;
            padding-bottom: 50px;
        }
    </style>
    <script type="text/javascript">
        window.onload=function(){
           var button = document.querySelector("button");
           var content = document.querySelector(".content");
           button.onclick=function(){
               for (let i = 0; i < 10; i++) {
                   content.innerHTML = content.innerHTML+i+"<br/>";
               }
           }
        }
    </script>
</head>
<body>
<button style="position: absolute;left: 0;top: 0;">
    点击我
</button>
<div class="box wrapper">
    <div class="content"></div>
</div>
<div class="box footer"></div>
</body>
</html>